package com.tuo51.foudation.constant;

import lombok.Setter;

/**
 * *******************************
 * Created by Ron.
 * form com.tuo51
 * on 2017/8/2
 * *******************************
 */
public class PermissionConstant {



    public static final String CD_YJY="33386743";



    public enum Role{
        ADMIN("ROLE_ADMIN", "管理员"),
        GARDEN_LEADER("ROLE_GARDEN_LEADER", "园长"),
        EXECUTE_LEADER("ROLE_EXECUTE_LEADER", "执行园长"),
        TEACHER("ROLE_TEACHER", "老师"),
        DOCTOR("ROLE_DOCTOR", "医生"),
        RESEARCHER("ROLE_RESEARCHER", "研究员"),
        NURSE("ROLE_NURSE","保育员"),
        ;

        @Setter
        private String code;

        @Setter
        private String value;

        Role(String code, String value){
            this.code = code;
            this.value = value;
        }

        public String codeOf(){
            return code;
        }

        public String valueOf(){
            return value;
        }

        public Role get(String code){
            for (Role role : values()) {
                if (role.codeOf()==code)
                    return role;
            }
            return null;
        }
    }

}
